package com.cc.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;

@PropertySource(value = "classpath:MyBean.properties",encoding = "UTF-8")
public class MyBeanConfig {

    @Value("${name}")
    private String name;
    @Value("${sex}")
    private String sex;
    @Value("${data}")
    private String data;

    @Bean
    public void showMyBean(){
        System.out.println("你的名字:" + name);
        System.out.println("性别为:" + sex);
        System.out.println("你的生日为:" + data);
    }
}
